/**
 * 跳转 防止页面卡死
 */
export const jumpTo = (url, param = {}, needVavigateTo = true) => {
  let pageList = getCurrentPages();
  url = /\?/.test(url) ? url : `${url}?`;
  for (let key in param) {
    url += `${key}=${param[key]}&`
  }
  if (param && JSON.stringify(param) != '{}') {
    url = url.substr(0, url.length - 1);
  }

  if (pageList.length < 10 && needVavigateTo) {
    wx.navigateTo({ url: url });
  } else {
    wx.redirectTo({ url: url });
  }
}